package com.scitc.pleasurevideo.util;

import java.text.SimpleDateFormat;

public class TimeUtil {

    /*
     * 日期获取 按照毫秒
     */
    public static String getDate(long time) {
        SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd");
        return sfd.format(time);
    }
    public static String getLeftTime(int interval) {
        int hour = interval / 3600000;
        interval = interval / 1000;
        int seconds = interval % 60;
        interval = interval / 60;
        interval = interval % 60;
        int minutes = interval;

        if (hour > 0) {
            return "0" + hour + ":" + (minutes < 10 ? "0" + minutes : minutes)
                    + ":" + (seconds < 10 ? "0" + seconds : seconds);
        }
        return (minutes < 10 ? "0" + minutes : minutes) + ":"
                + (seconds < 10 ? "0" + seconds : seconds);
    }

}
